//
//  SCRefreshView.m
//  Mutal
//
//  Created by TonyStart on 16/10/25.
//  Copyright © 2016年 com.wx. All rights reserved.
//

#import "SCRefreshView.h"

@interface SCRefreshView()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *alertLabel;
@property (weak, nonatomic) IBOutlet UILabel *refreshTimelabel;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityView;

@end



@implementation SCRefreshView

-(void)changeContentWithRefreshState:(SCRefreshState) state{
    if (state == Normal) {
        //先恢复视图状态
        [self.activityView stopAnimating];
        [self.imgView setHidden:NO];
        self.alertLabel.text = @"用点力..";
        [UIView animateWithDuration:0.25 animations:^{
            self.imgView.transform = CGAffineTransformIdentity;//
        }];
    }else if(state == Pulling){
        
        [UIView animateWithDuration:0.25 animations:^{
            self.imgView.transform = CGAffineTransformMakeRotation(M_PI-0.001);
            
        }];
        self.alertLabel.text = @"松开后刷新..";
    }else{
        [self.imgView setHidden:YES];
        
        [self.activityView startAnimating];
        self.alertLabel.text = @"正在刷新";
    }
}



@end
